﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using pygs.Classes;

namespace pygs.Locator
{
    class FakeLocator : CustomLocator
    {
        private Random rnd = new Random();

        private Location ll;

        protected override Location GetLastLocation()
        {
            return ll;
        }

        public override Location GetCurrentLocation()
        {
            return ll;
        }

        public override void ProccessNewLocations()
        {
            if (rnd.Next(0, 100) > 50)
            {
                Location loc = new Location();
                loc.Latitude = rnd.Next(0, 180);
                loc.Longitude = rnd.Next(0, 180);
                ll = loc;
                DoNewLocation(loc);
            }
        }

        public override void Start()
        {
        }

        public override void Stop()
        {
        }

        protected override LocatorStatus GetStatus()
        {
            return LocatorStatus.Connected;
        }
    }
}
